package com.beiding.test;

import com.beiding.oa2.ObjectSet;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class T {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, ScriptException {

        ScriptEngineManager scriptEngineManager = new ScriptEngineManager();

        ScriptEngine js = scriptEngineManager.getEngineByName("js");

        A a = new A();
        js.put("a", a);
        js.eval("print(a.c)");

        ObjectSet objectSet = new ObjectSet();
        objectSet.add(js);

        objectSet.scan();
        objectSet.changeType(C2.class, C1.class);
        js.eval("print(a.c)");

    }
}
